#ifndef _IR_H_
#define _IR_H_

#include "types.h"
#include "libusb.h"

typedef enum {
	LSB_FORMAT,
	MSB_FORMAT,
} data_format_t;

typedef struct {
	uint16_t forestTime;
	uint16_t plainTime;
} ir_bit_time_t;

typedef struct {
	uint16_t carrierFreq;
	uint16_t carrierDuty;
	uint16_t dataFormat;
	ir_bit_time_t startBit;
	ir_bit_time_t stopBit;
	ir_bit_time_t logicalBit1;
	ir_bit_time_t logicalBit0;
} ir_coding_t;

int writeIRData(libusb_device_handle *usbdev_handle, char *data, int bits, const char sn[6]) ;
int configIR(libusb_device_handle *usbdev_handle, const char *data, const char sn[6]) ;
int writeACCode(libusb_device_handle *usbdev_handle, int isTurnOn, int isColdMode, int temperature, const char sn[6]);

#endif
